<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>
    <title>安平通行码</title>
    <link rel="stylesheet" href="./layui/css/layui.css" media="all">
    <script src="./jquery/jquery.min.js"></script>
    <style>
        * {
            background: #F2F6FB;
        }

        .imgs {
            text-align: center;
            margin-top: 80px;
        }

        .layui-text {
            background: #D7E8FF;
            line-height: 16px;
            color: #265DA4;
            font-weight: bolder;
            font-size: 16px;
        }

        .layui-elem-quote {
            text-align: center;
            border-left: none;
        }
    </style>
</head>

<body>
    <!-- 按钮 -->
    <blockquote class="layui-elem-quote layui-text">
        安平通行码登记
    </blockquote>
    <div class="imgs" onclick="goTwo()">
        <img src="./images/picone.png" alt="" width="300px">
    </div>
    <div class="imgs" onclick="goOne()">
        <img src="./images/pictwo.png?v=01" alt="" width="300px">
    </div>
    
    <script>
        // 1.从注册页面跳转过来的open_datas 包括 openid 和 rukouId 和 身份证号 和中文的入口地址 和姓名
        var open_data = getQueryVariable("state")
        console.log('按钮页面的参数:'+open_data)
        // 拿到地址栏code
        function getQueryVariable(variable) {
            // 参数 window.location.search
            var query = decodeURI(window.location.search.substring(1))
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
            return (false);
        }

        function goOne() {
            //alert("去本单位")
            window.location.href =encodeURI("http://hesuan.city1000.cn/codesure/password.html?state=" + open_data) 
        }

        function goTwo() {
            //alert("去访客页面")
            //(实际是openid 和 rukouId 和 身份证号 和中文的入口地址和姓名)
            window.location.href =encodeURI("http://hesuan.city1000.cn/codesure/no.html?state=" + open_data) 
        }
    </script>
</body>

</html>